<?php
/**
 * Created by PhpStorm.
 * User: tri
 * Date: 8/13/2014
 * Time: 9:53 AM
 */

$voter = $this->data;
$voter = $voter[0];
?>

<?php

$avatar = $voter['avatar'];
if(strstr($avatar,'facebook') == false){
    $avatar =   URL_BASE."public/avatar/".$voter['avatar'];
    $status = get_headers($avatar);
    if($voter['avatar'] == ''){
        $avatar =  URL_BASE."thumb/48-48-public/avatar/avatar.png";
    }
   // echo $avatar;
}
//echo $voter['avatar'];
?>

<div class="container_grid grid_1 who_follow_grid user-porfile-form">
    <form action="" method="POST" enctype="multipart/form-data">
   			<span class="grid_title_small">Profile info</span>
            <div id="whoBox">
                <input type="hidden" name="pId"  value="<?php echo $voter['id']; ?>">
        <!-- whoContainer -->
        <div class="whoContainer">
            <img style="width: 250px" class="full-width avatar_user" src="<?php echo $avatar; ?>">
             <span class="detail_grid_right full-width">
   		       <input type="file" <?php if($_SESSION['authenticated'] != $voter['id']) echo 'disabled' ;?> name="pAvatar" class="text-profile full-width width-90" value="">
   		    </span>
        </div>
        <!-- whoContainer -->
        <div class="whoContainer">
            <label>User Name</label>
   		    <span class="detail_grid_right full-width">
   		       <input type="text" name="pName" disabled class="text-profile full-width width-90" value="<?php echo $voter['username'] ?>">
   		    </span>
        </div>
        <!-- whoContainer -->
        <div class="whoContainer">
            <label>Name</label>
   		    <span class="detail_grid_right full-width">
   		        <input type="text"  <?php if($_SESSION['authenticated'] != $voter['id']) echo 'disabled' ;?> name="pName" class="text-profile full-width width-90" value="<?php echo $voter['name'] ?>">
   		    </span>
        </div>



        <div class="whoContainer">
                    <label class="full-width">Birth</label>
   		    <span class="detail_grid_right full-width ">
   		      <input type="text" <?php if($_SESSION['authenticated'] != $voter['id']) echo 'disabled' ;?> class="text-profile full-width width-90 " id="datepicker" name="pBirth" value="<?php echo date('d-m-Y',$voter['birth']); ?>">
   		    </span>
                </div>

        <!-- whoContainer -->
        <div class="whoContainer">
            <label>Sex</label>
   		    <span class="detail_grid_right full-width">
   		        <select <?php if($_SESSION['authenticated'] != $voter['id']) echo 'disabled' ;?> name="pSex" class="text-profile full-width">
                    <option value="male" <?php if($voter['sex']=='male') echo 'selected';  ?> >Male</option>
                    <option value="female" <?php if($voter['sex']=='female') echo 'selected';  ?>>Female</option>
                </select>
   		    </span>
        </div>
                <?php if($_SESSION['authenticated'] == $voter['id']) {?>
                    <div class="whoContainer">
                        <input type="submit" style="cursor: pointer" class="submit-button-nopass text-profile full-width " value="Update Profile ">
                    </div>
                <?php } ?>
        <!-- whoContainer -->
                <?php if($_SESSION['authenticated'] == $voter['id']){?>
                    <div class="whoContainer">
                        <label>New Password</label>
<!--   		    <span class="detail_grid_right full-width">-->
<!--   		        <input type="password" name="pPass" class="password-container text-profile full-width width-90" value="">-->
<!--   		    </span>-->

                        <!--confirm pass -->
                        <p>
                            <span class="error">Password must be 8 characters long</span>
                        </p>
                        <div class="password-container">
                            <p>
                                <label>
                                    Password:</label>
                                <input name="pPass"  class="strong-password" type="password" />
                            </p>
                            <p>
                                <label>
                                    Confirm Password:</label>
                                <input class="strong-password" type="password" />
                            </p>
                            <div class="strength-indicator">
                                <div class="meter">
                                </div>
                                <ul>
                                    <li>   Strong passwords contain 8-16 characters.</li>

                                    <li>   Combine uppercase letters, lowercase letters, numbers, and symbols.</li>
                                </ul>

                            </div>
                        </div>


                        <!--end confirm pass -->

                        <input type="submit" style="cursor: pointer" class="submit-button text-profile full-width " value="Update Password ">
                    </div>
                <?php  }?>
        <!--- -->

        <!-- whoContainer -->

    </form>

    <div class="wrapper">


    </div>

    </div>
            <!-- whoBox -->

</div>
